The project ‘Soil Moisture Meter using Arduino’ uses arduino board, a 16×2 LCD module and soil moisture sensor in order to display the humidity (moisture) of soil.
This project is very useful for farmer, floriculture, researchers etc. in order to know the moisture of soil at different stage. The working principle and circuit description is very simple that anymore can understand who have little knowledge of arduino board. The project is basically an interfacing circuit between arduino board with LCD and sensor. Previously, we had posted Greenhouse Automation System for easy, cost effective, portable and easy maintenance alternative for greenhouse applications, beneficial for small scale agriculture sectors in remote areas.
Circuit Description of Soil Moisture using Arduino
The circuit of soil moisture meter using arduino consist of arduino uno board (MCU), LCD (to display data), soil moisture sensor.
Soil moisture sensor I basically a transducer which convert soil moisture to electrical signal. The sensor has various element i.e. probe, wire and body. The two-metallic probe made from galvanized steel dipped into soil which measure the flow of electrical current between these two probes. The electric current between these two probes is further process and changed into possible electrical value and display on LCD.
Variable resistor VR1 is used to calibrate the moisture of soil, where wiper is connecting to pin A2 of arduino board. Variable resistor VR2 is used to control the contrast of LCD where resistor R2 is used to limit the current of backlight of LCD.
Software Code for Soil Moisture Meter using Arduino
You can directly download the code from below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
#include <LiquidCrystal.h> LiquidCrystal lcd(8,9,4,5,6,7); // lcd hardware interface int levelUp = 600; // see calibration notes int levelDown = 300; // see calibration notes int probeIn = 1; // sensor head input to A1 void setup(){ Serial.begin(9600); lcd.begin(16, 2); //size of the LCD lcd.setCursor(0,1); lcd.print("Welcome To Soil"); lcd.setCursor(1,0); lcd.print("Moisture Meter"); delay(1000); lcd.clear(); } void loop(){ String DisplayNote; int probeValue; probeValue = analogRead(probeIn); lcd.setCursor(0,1); lcd.print("Soil Meter"); // custom message if (probeValue < levelDown){ String DisplayNote = "Dry, Water Me!"; lcd.setCursor(1,0); lcd.print(DisplayNote); } else if (probeValue > levelUp){ String DisplayNote = "Wet, Leave Me!"; lcd.setCursor(1,0); lcd.print(DisplayNote); } else { lcd.setCursor(1,0); lcd.print(DisplayNote); } } |
Procedure for calibration of Soil Moisture Meter using Arduino
- Burn the software code in arduino uno board using arduino IDE.
- Connect the entire circuit elements as shown in circuit diagram and after that connect power supply to the circuit.
- Dip two metallic probe into soil which is wet enough.
- Adjust the variable resistor VR1 in order to get 3V at pin A1.
- The calibration should be done for various sample of soil ranging from dry to wet.
PARTS LIST OF SOIL MOISTURE METER USING ARDUINO
Resistors (all ¼-watt, ± 5% Carbon) |
R1 = 120 Ω
R2 = 100 Ω VR1, VR2 = 10 KΩ |
Semiconductors |
T1 = BC547 (Silicon NPN Transistor)
16×2 LCD Arduino uno board |
Miscellaneous |
Soil Sensor Probes
Connectors |